﻿namespace GTAuto.DAL.Entities
{
    public class GTModel : Model
    {
        public void UpdateTo(Model c)
        {
            foreach (var prop in c.GetType().GetProperties())
            {
                var prop2 = c.GetType().GetProperty(prop.Name);
                prop2.SetValue(this, prop.GetValue(c, null), null);
            }
        }

        public string NameDate
        {
            get
            {
                
                if(Year!=null)
                {
                    return string.Format("{0}({1})", Name, Year);
                }
                return Name;
            }
        }
    }
}
